<!doctype html>
<html lang="cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="{{asset('/css/mdui.min.css')}}"> @yield('css')
    {{--<link rel="stylesheet"--}}
    {{--href="{{asset('static/bootstrap/css/bootstrap.min.css')}}">--}}
    {{--<!-- jQuery 文件 -->--}}
    {{--<script src="{{asset('static/jquery/jquery.min.js')}}"></script>--}}
    {{--<!-- Bootstrap JavaScript 文件 -->--}}
    {{--<script src="{{asset('static/bootstrap/js/bootstrap.min.js')}}"></script>--}}
    <title>@yield('title','后台管理系统')</title>

    <style>
        .alert {
            position: absolute;
            width: 300px;
            height: 100px;
            text-align: center;
            font-size: 20px;
            line-height: 100px;
            background: rgba(0, 0, 0, 0.3);
            padding: 0px;
            left: 40%;
            top: 40%;
            display: none;
            border-radius: 10px;
        }
    </style>
</head>

<body class="mdui-drawer-body-left mdui-appbar-with-toolbar mdui-theme-primary-blue mdui-theme-accent-blue">
{{--顶部应用栏--}}
<div class="mdui-appbar mdui-appbar-fixed">
    <div class=" mdui-toolbar mdui-color-blue">
            <span class="mdui-btn mdui-btn-icon mdui-ripple mdui-ripple-white" mdui-drawer="{target: '#main-drawer'}">
            <i class="mdui-icon material-icons">menu</i>
        </span>
        <a href="{{url('/admin')}}" class="mdui-typo-headline mdui-hidden-xs">后台管理系统</a>
        <a href id="page_title" class="mdui-typo-title"></a>
        <div class="mdui-toolbar-spacer"></div>
        <a class="mdui-typo"></a>{{Session::get('admin_user.name')}}</a>
        <a class="mdui-typo" href="{{url('/admin/logout')}}">退出</a>
    </div>
</div>
{{--抽屉导航栏--}}

<div class="mdui-drawer mdui-drawer-scrollbar" id="main-drawer">
    <div class="mdui-list" mdui-collapse="{accordion: true}" style="margin-bottom: 76px;">
        @foreach($tree as $key => $value)
            <div class="mdui-collapse-item">
                <div class="mdui-collapse-item-header mdui-list-item mdui-ripple">
                    <i class="mdui-list-item-icon mdui-icon material-icons mdui-text-color-blue">art_track</i>
                    <div class="mdui-list-item-content">{{$key}}</div>
                    <i class="mdui-collapse-item-arrow mdui-icon material-icons"></i>
                </div>
                <div class="mdui-collapse-item-body mdui-list">
                    @foreach($value as $v)
                        <a href="{{url($v->display_name)}}"
                           class="mdui-list-item mdui-ripple {{(Request::getPathInfo()=='/'.$v->display_name)?'mdui-list-item-active':''}}">{{$v->name}}</a>
                    @endforeach
                </div>
            </div>
        @endforeach
    </div>
</div>

<div class="mdui-container main-container mdui-p-t-3">
    @yield('content')
</div>
@if(session('mess'))
    <script>
        $(".alert").html('{{session('
                mess ')}}').show().delay(1000).fadeOut(1000);
    </script>
@endif
<script src="{{asset('/js/jquery-1.8.3.min.js')}}"></script>
<script src="{{asset('/js/jquery.validate.min.js')}}"></script>
<script src="{{asset('/js/mdui.min.js')}}"></script>
<script>
    $(function () {
        $('.mdui-list-item-active').parent().parent().addClass('mdui-collapse-item-open');
        $('#page_title').text($('.mdui-list-item-active').text());
    });
</script>
@yield('js')
</body>

</html>
